' *********************** initialization begin ************************
Set Buffer 70 : Rem enough for 1000 records
A#=0.0
Fix(2) : Rem limits floating point #'s to two digits
Global BASE$,BASEDIR$,BASEFILE$,H0MEY,PROG$,VER$
Global B1,B2,B3,R1,R2,R3,H1,H2,H3,M1,M2,M3,_MOUSE
Global LP,PAG,FF,SORETED,MXENTRIES,ACCTWRK$,DEF_ENTRIES,LAST_DATE$,LAST_DESCR$
Proc INIT : Rem this needs to be here in order to get the correct value of mxentries
Dim DATE$(MXENTRIES),DESCR$(MXENTRIES),DEBIT#(MXENTRIES),CREDIT#(MXENTRIES),DISPLAY(MXENTRIES)
Dim DESCRIPTOR$(10),COMMENT$(10),GOAL(10),BASE_ACCT$(10)
Dim CAT_TOTALS_DEB#(10),CAT_TOTALS_CRED#(10)
Dim CAT_PERCEN_DEB#(10),CAT_PERCEN_CRED#(10)
Global ACCT$,BGT$,RECNUM,TYPE$,DATE$(),DESCR$(),DEBIT#(),CREDIT#(),DISPLAY(),BASE_ACCT$()
Global CAT_TOTALS_DEB#(),CAT_TOTALS_CRED#()
Global CAT_PERCEN_DEB#(),CAT_PERCEN_CRED#()
Global DISP_TOP,DISP_BOTTOM,VIRT_IDX,PAD
Global DESCRIPTOR$(),COMMENT$(),GOAL(),BGT$,CUR_ACCT
Global R_OT,R_OBA,R_OBU,R_SP,ALL_BALANCE#
'
DISP_TOP=6 : DISP_BOTTOM=23 : Rem data is displayed on editing screen from lines 6 to 23
VIRT_IDX=1 : Rem this puts us at the first location of display()
DISPLAY(VIRT_IDX)=1 : Rem this sets up our first element in display()
'
'
Procedure VAR_D0CS
' base$ is the pathname of the last transaction base that was loaded
' basedir$ is just the path of the base$ - filename is truncated
' basefile$ - is just the file of the base$ - path is truncated
' h0mey is a boolean which shows whether or not h0mescreen is being up to date
' prog$ gives the program name
' ver$ gives the version of prog$
' acct$ holds the name of the current/last acct that was edited
' recnum gives the # of entries in current/last acct that was edited
' type$ gives the type of account: "Asset" or "Liability"
' date$() is the list of dates from the current/last acct
' descr$() is the list of descriptions from the current/last acct
' debit() is the list of debits from the current/last acct
' credit() is the list of credits from the current/last acct
' display() is the list of index numbers which appear on the screen
' Ex: display(1)=55 shows that record #55 is line 1 of display()
' display() is actually a virtual screen as the whole thing can't be displayed at once
' acctwrk$ holds last acct name touched by another function besides edit
' prefs globals:
' for colors - b1,b2,b3,r1,r2,r3,h1,h2,h3,m1,m2,m3
' for printer defaults - lp,pag,ff
' for acct transaction sorting (T/F) - soreted
' for max # of entries in an acct - mxentries
' for type of mouse pointer to use - _mouse:
' 1 = arrow (default)
' 2 = crosshairs
' 3 = system mouse pointer
' for default values given to inputs - def_entries
' 1 = blank or zeros (default)
' 2 = last value entered
' 3 = "None" or zeros
' for holding the previous values input into a data line in the account editor
' - last_date$, last_descr$
'
' disp_top shows the literal of the top of our editing window
' disp_bottom shows the literal of the bottom of our editing window
' virt_idx shows where we are on in the virtual screen display()
' pad - boolean which shows whether or not user is in keypad mode in the edit screen
' descriptor$(), comment$(), goal() is for the budget editor
' bgt$ holds name of current budget file
' base_account$ - holds names of accts in current transaction base
' cur_acct - used for indexing in the base editor
' for reports:
'r_ot - output transactions?
'r_oba - output balance?
'r_obu - output budget info?
'r_sp - output to screen or printer?
'all_balance# - transaction base worth
'
'cat_totals_deb#(),cat_totals_cred#() - for showing the totals of each category of which there can be ten (budgets)
'cat_percen_deb#(),cat_percen_cred#() - shows how much of debits/credits that a category takes of the account total for debits/credits
End Proc
Procedure COMMENTS
'
'1)
' there are 4 different types of files used in this programs for input and
' they all have the following headers (though content afterwards varies):
'
' prog$+" "+"{Base, Acct, Prefs, Budget}"
' ver$
' this uniformity in headers will allow future versions to ID these files
' and convert or use them
'
'
'2)
' approximately 15 records will fit into each K of memory.
'
'3)
' each transaction base is meant to cover only one money tool (e.g. checking, savings, etc.)
'
'4)
' colors:
' # purpose
'
' 0 background
' 1 regular
' 2 highlight
' 3 menu
'
End Proc
Procedure INIT
PROG$="The Home Accountant"
VER$="1.1"
Screen Open 0,640,200,4,Hires
Palette 0,0,0,0 : Cls
Flash Off : Rem necessary to manipulate color #3
If Exist("s:HomeAccountant.prefs")
PREFS_LOAD["s:HomeAccountant.prefs"]
Else
PREFS_DEFAULT
End If
Curs Off
Pen 1 : Paper 0 : Cls
R_OT=False : R_OBA=True : R_OBU=True : R_SP=True
H0MEY=False
End Proc
'************************* initialization end **************************
'
'
'************************* main run loop begin *************************
On Error Proc ERR_CATCH : Rem this routine simply notifies of the error and attempts to redo the line which created the error, may cause an endless loop
Break Off : Rem we turn off the control-c to save cpu and prevent incomplete files and such
If Not Exist("libs:mathtrans.library")
N0TICE["I need libs:mathtrans.library to function correctly.",0]
N0TICE["Unless you have preloaded it, I may quit unexpectedly.",0]
End If
_STARTING_POINT:
Proc MENU
Goto _STARTING_POINT
'************************* main run loop end ***************************
'
'
'************************* procs begin *********************************